
package aseCrypto;

import java.math.BigInteger;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author haui
 */
public class AseIntegerTestCompareTo {
    
    AseInteger my160;
    AseInteger my20;
    
    AseInteger myBig1;
    

    @Test
    public void testTwoTimesTheSameAseInteger() {
        
        assertEquals(my160,my160);

        
    }

    
    @Test
    public void testTwoTimesTheSameNumberFromStringEqual() {
        
        assertEquals(1,1);
        
        assertEquals(new AseInteger("1"),new AseInteger("1"));

        
    }    

    
    @Test(expected=AssertionError.class)
    public void testTwoTimesTheSameNumberFromStringUnEqual1() {
        
        assertEquals(1,1);
        
        assertEquals(new AseInteger("1"),new AseInteger("2"));

        
    }       
    
    
    @Test(expected=AssertionError.class)
    public void testTwoTimesTheSameNumberFromStringUnEqual2() {
        
        assertEquals(1,1);
        
        assertEquals(new AseInteger("2"),new AseInteger("1"));

        
    }       
    
    
    @Test(expected=AssertionError.class)
    public void testTwoTimesTheSameNumberFromStringUnEqualNull1() {
        
        assertEquals(1,1);
        
        assertEquals( null,new AseInteger("1"));

        
    }      

    
    @Test(expected=AssertionError.class)
    public void testTwoTimesTheSameNumberFromStringUnEqualNull2() {
        
        assertEquals(1,1);
        
        assertEquals( new AseInteger("1"), null);

        
    }         
    
    
    @Test
    public void testTwoTimesTheSameNumberFromWithCompareTo() {
        
        assertEquals(1,1);
        
        assertEquals (0,new AseInteger("1").compareTo(new AseInteger("1") ) );

        
    }        
    
    
  
    
    @Test
    public void testTwoTimesTheSameNumberFromBigIntegerWithString() {
        
        assertEquals(1,1);
        
        assertEquals(new BigInteger("1"),new BigInteger("1"));

        
    }    
    
    
    @Test
    public void testTwoTimesTheSameNumberFromBigIntegerWithLong() {
        
        assertEquals(1,1);
        
        assertEquals(new BigInteger( new Long("1").toString()),new BigInteger( new Long("1").toString()));

        
    }        
    

    
    @Test
    public void testOneTimeTheSameNumberFromString() {
        
        assertEquals(1,1);
        
        AseInteger aI = new AseInteger("1");
        
        assertEquals( aI, aI);

        
    }       


    @Test
    public void testEqualsWithAnotherAseInteger() {
        
        AseInteger a = new AseInteger("0");
        
        assertTrue(a.equals(AseInteger.ZERO));
        
    }       
      
    
}
